import request from "@/utils/request"
export interface LoginParamsType {
    username: string
    password: string,
}
export interface LoginResultType {
    token: string
}

export interface UserInfoType {
    routes: string[];
    buttons: string[];
    roles: string[];
    name: string;
    avatar: string;
}
// 登陆请求
export const reqLogin = (userInfo: LoginParamsType) => {
    return request.post<null, LoginResultType>(`/admin/acl/index/login`, userInfo)
}

// 退出登陆请求
export const reqLayOut = () => {
    return request.post<null, null>(`/admin/acl/index/logout`)
}

// 获取用户信息
export const reqUserInfo = () => {
    return request.get<null, UserInfoType>(`/admin/acl/index/info`)
}